package exp1;

import java.util.Scanner;

public class factorial2 {
    public static long fact (int n) {
        if (n > 1) {
            return fact(n - 1) * n;
        }
        return 1;
    }
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        // start
        long stime = System.nanoTime();
        System.out.println(fact(n));
        // end
        long etime = System.nanoTime();
        System.out.println(etime - stime);
    }
}
